// @ts-ignore
/* eslint-disable */
import request from '@/utils/request'

/** 此处后端没有提供注释 GET /get/login */
export async function getLoginUser(options?: { [key: string]: any }) {
  return request<API.BaseResponseUserLoginRespDTO>('/user/get/login', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /login */
export async function userLogin(
  body: API.UserLoginRequestDTO,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseUserLoginRespDTO>('/user/login', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /logout */
export async function userLogout(options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/user/logout', {
    method: 'POST',
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /register */
export async function userRegister(
  body: API.UserRegisterRequestDTO,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseString>('/user/register', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 此处后端没有提供注释 POST /send/code */
export async function sendCode(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.sendCodeParams,
  options?: { [key: string]: any },
) {
  return request<API.BaseResponseString>('/user/send/code', {
    method: 'POST',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}
